<script>
export default {
  name: 'ProvideComponent'
}
</script>
<script setup>
import { watch, inject } from 'vue'
import { useAttrs } from 'vue'
import { getCurrentInstance, provide, ref } from 'vue'

// 该组件不参与视图，仅参递参数

defineOptions({
  // 不允许参递参数
  inheritAttrs: false
})

const store = inject('store')

// 获取当前实例
const instance = getCurrentInstance()

// 获取所有属性
const attrs = instance.attrs
// const attrs2 = useAttrs()
// console.log(123, attrs.row)
for (const key in attrs) {
  provide(key, attrs[key])
}
</script>

<template>
  <slot></slot>
</template>

<style scoped lang="scss">
// start
</style>
